<template>
	<view class="mywallet" v-if="userinfo">

		<view class="list" @click="navClickHandle(1)">
			<view class="lt_t">
				我的钱包余额
				<image src="/static/rig.png"></image>
			</view>
			<view class="lt_b">
				<span>
					￥
				</span>
				<span class="money">{{userinfo.money}}</span>
			</view>
		</view>
		
		<view class="list"  @click="navClickHandle(2)">
			<view class="lt_t">
				我的现金积分
				<image src="/static/rig.png"></image>
			</view>
			<view class="lt_b">
				<span class="money">{{userinfo.score}}</span>
			</view>
		</view>
		
		<!-- <view class="list" @click="navClickHandle(3)">
			<view class="lt_t">
				我的红包余额
				<image src="/static/rig.png"></image>
			</view>
			<view class="lt_b">
				
				<span class="money">{{userinfo.jindou}}</span>
			</view>
		</view> -->
	
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo:null
			};
		},
		onShow() {
			this.get_userinfo();
		},
		methods: {
			navClickHandle(type) {
				uni.navigateTo({ url: '/pages/my/mywallet_dea?type='+type });
			},
			get_userinfo(){
				let that = this;
				uni.showLoading({ title: '正在加载', mask: true });
				uni.hideLoading();
				that.$api.request('/api/user/get_info', {},uni.getStorageSync('token'), function(res) {
								uni.hideLoading()
								if (res.code === 1) {
									that.userinfo = res.data
								} else {
									uni.showToast({
										title: res.msg,
										icon: 'none'
									})
								}
				});
				
			},

			// 跳转设置
			jumpSetting() {
				uni.navigateTo({
					url: '/pages/settings/settings'
				});
			},

			// 跳转分享页面
			jumpShare() {
				uni.navigateTo({
					url: '/pages/share/share'
				});
			}
		}
	};
</script>

<style lang="less">
	page {
		background: #f3f3f3;
	}
	.mywallet{
		.list{
			width: 96%;
			margin-left: 2%;
			margin-top: 20rpx;
			background: #fff;
			border-radius: 0.5em;
			padding-top: 24rpx;
			font-size: 26rpx;
			// font-size: ;
			font-weight: 700;
			padding-bottom: 25rpx;
			.lt_t{
				margin-left: 35rpx;
				image{
					width: 35rpx;
					height: 35rpx;
					position: relative;
					right: 22rpx;
					top:36rpx;
					float: right;
					
				}
			}
			.lt_b{
				margin-left: 30rpx;
				font-size: 34rpx;
				margin-top: 10rpx;
			
				.money{
					font-size: 45rpx;
				}
				
			}
		}
	}
</style>
